Home

Operator Usage

Name

pick

Description

pick[n] input-seq
randomly pick n elements from each superposition in the input sequence
if n is greater than the size of the superposition, then only return size(superposition) elements
if n is less than or equal 0, return the empty ket


Examples

-- randomly pick three elements from the given superposition:
pick[3] (|one> + |two> + |three> + |four> + |five> + |six> + |seven>)
    |three> + |seven> + |four>


See also

Operator type

core compound